﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CJJCH.Web.Manage
{
    public partial class ConsultingDetails : PowerBase
    {
        CJJCH.BLL.T_NET_Consulting bll_con = new CJJCH.BLL.T_NET_Consulting();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitRequest();
                ShowConsulting();
            }
        }

        private void InitRequest()
        {
            if (!string.IsNullOrEmpty(Request.QueryString["ID"].ToString()) && LTP.Common.CheckInput.CheckGUID(Request.QueryString["ID"].ToString()))
            {
                ViewState["ID"] = Request.QueryString["ID"].ToString();
            }
            else
            {
                LTP.Common.WindowClass.WindowBack("操作错误！");
            }
        }

        private void ShowConsulting()
        {
            CJJCH.Model.T_NET_Consulting model = new CJJCH.Model.T_NET_Consulting();
            model = bll_con.GetConsultingModel(new Guid(ViewState["ID"].ToString()));
            if (model!=null)
            {
                this.lblTitle.Text = model.DataTitle;
                this.lblSource.Text = model.DataSource;
                this.lblAuthor.Text = model.DataAuthor;
                this.lblPlusDate.Text = model.PlusDate.ToString("yyyy/MM/dd");
                this.lblOrderNum.Text = model.OrderNum.ToString();
                this.lblType.Text = model.MenuFirst.MenuName + "->" + model.MenuSecond.MenuName;
                if (model.MenuSecond.HaveChild)
                {
                    this.lblType.Text += "->" + model.MenuThird.MenuName;
                }
                this.lblNote.Text =  model.DataNote;

            }
            else
            {
                LTP.Common.WindowClass.WindowBack("操作错误！");
            }


        }
        
    }
}